package com.rookie.rabbit.modular.demo.enums;

import com.rookie.rabbit.modular.enums.RabbitArgumentEnum;
import com.rookie.rabbit.modular.util.RabbitArgumentBuilder;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * @author rookie
 */

@Getter
@AllArgsConstructor
public enum QueueEnum {

    /**
     * 队列
     */
    TEST_QUEUE("测试队列",null,null,null,null,null),

    EMAIL_PUSH("邮箱通知队列","email-push-queue", 1, 0,  "emailPushQueue",
            RabbitArgumentBuilder.build()
                    .addParam(RabbitArgumentEnum.X_MESSAGE_TTL, 10000)
                    .finish()
    ),

    SMS_PUSH("短信通知队列","sms-push-queue", 1, 1,  "smsPushQueue",
            RabbitArgumentBuilder.build()
                    .addParam(RabbitArgumentEnum.X_EXPIRES, 30000)
                    .finish()
    ),

    USER_ONE_QUEUE("用户1队列", "user-one-queue", 1, 0, "userOneQueue", null),

    USER_TWO_QUEUE("用户2队列", "user-two-queue", 1, 0, "userTwoQueue", null),

    USER_ORDER_QUEUE("用户下单队列","user-order-queue", 1, 0,  "userOrderQueue", null),

    USER_LOGOUT_QUEUE("用户登出队列", "user-logout-queue", 1, 0, "userLogoutQueue", null),

    SYSTEM_NOTICE_QUEUE("系统通知队列","system-notice-queue", 1, 0,  "systemNoticeQueue", null);

    /**
     * 队列描述
     */
    private String digest;

    /**
     * 队列名称 默认通过枚举转换 X-X-X
     */
    private String name;

    /**
     * 是否持久化 默认是 1
     */
    private Integer durable;

    /**
     * 是否自动删除 默认是 0
     */
    private Integer autoDelete;

    /**
     * bean名称 默认通过枚举转换 smsPushQueue
     */
    private String beanName;

    /**
     * 配置附加参数
     */
    private Map<String, Object> args;

}
